<!DOCTYPE html>
{% load static %}
<html lang="zh-cn">
<head>
    <script type='text/javascript' src="static/fybjs/htmlAceControlShow.js"></script>
    <script>
        headLoadFile('新一代工业软件应用商店');
    </script>
    <!--付颖斌的js文件-->
    <script type='text/javascript' src="static/fybjs/httpDataTransFyb.js"></script>
    <script>
        $.ajaxSetup({data:{csrfmiddlewaretoken:'{{ csrf_token }}'}})
    </script>

</head>
<body class="no-skin">
<!--导航栏index-->
<script>
    //权限控制
    jumpURL=getAuthURL(window.location.href);
    if(jumpURL!=window.location.href){window.location.href=jumpURL;}else{};
    //加载内容
    shortCutText=['平台主页','数据聚合','情景推荐'];
    shortCutText=[];
    shortCutLiColor=['grey','purple','green'];
    shortCutHref=['#','#','https://www.baidu.com'];
    shortCutSrc=['static/ace/assets/images/avatars/platform.png','static/ace/assets/images/avatars/process.png','static/ace/assets/images/avatars/support.png'];
    navBarShowAceIndexFyb("","新一代工业软件应用商店","工业软件库","欢迎光临",shortCutText, shortCutLiColor, shortCutHref, shortCutSrc);

</script>

<div class="main-container ace-save-state" id="main-container">
    <!--嵌入侧边栏-->
    <div class="sidebar responsive ace-save-state" id="sidebar">
        <!-- 功能按钮区域 -->
        <script>
            buttonClass=['btn btn-success','btn btn-info','btn btn-warning','btn btn-danger'];
            dataToggle=['tab','modal','modal','modal'];
            dataTarget=['#projectManagementDiv','#newProjectModal','#helpModal','#dangerModal'];
            buttonID=['','','',''];
            iClass=['ace-icon fa fa-cog','ace-icon fa fa-table','ace-icon fa fa-users','ace-icon fa fa-bell-o'];
            //leftTopNavBarControlButtonAceFyb(buttonClass, dataToggle, dataTarget, buttonID, iClass);
        </script>
        <!-- 侧边栏 -->
        <script>
            menuList=JSON.parse(getUserMenuList());
            menuActiveID=getNavBarMenuActiveId(getHtmlUrlAlone(location.href),menuList[0]['cotentDataHref'], menuList[0]['cotentMenuID'],"@");
            leftContentNavBarAceFyb(menuList[0]['titleData'], menuList[0]['titleiClass'], menuList[0]['titleHref'], menuList[0]['cotentData'], menuList[0]['contentiClass'], menuList[0]['cotentDataHref'],menuActiveID);
        </script>


    </div>
    <div class="main-content">
        <div class="main-content-inner">
            <!--嵌入面包屑-->
            <script>
                var titleBreadData=['新一代工业软件平台','#'];
                var searchString=['show','请输入名称'];
                var otherBreadData=new Array();
                otherBreadData[0]=['工业软件库','#'];
                otherBreadData[1]=['上传文件','#'];
                testID=breadCrumbsAceFyb(titleBreadData,otherBreadData, searchString);
            </script>

            <div class="page-content">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="tabbable">
                            <ul class="nav nav-tabs" id="myTab">
                                <script type='text/javascript'>
                                    subContentPageAceFyb('上传文件',true,'#');
                                </script>
                            </ul>
                            <div class="tab-content" id="pageContent">
                                <!--开始写入正文-->


                                <script>
                                    uploadFileToServerFyb(['请选择文件','选择','更换'],'upload-fyb-1', 'col-xs-12');
                                </script>
                                <form class="form-horizontal" role="form">
                                    <div class="tab-pane" id="ghi">
                                        <div id="submitButtonFyb" class="btn-group btn-group-sm" >
                                            <button type="button" class="btn btn-info" >
                                                <span class="glyphicon glyphicon-check"></span>提交
                                            </button>
                                        </div>
                                    </div>
                                </form>
                                <script>
                                    var btn = document.getElementById("submitButtonFyb");
                                    btn.onclick =function(){
                                        var form_data = new FormData();
                                        var file_info =$( '#upload-fyb-1')[0].files[0];
                                        form_data.append('file',file_info);
                                        var myDate = new Date();//当前日期
                                        var fileDir=myDate.getFullYear() + '//'+ myDate.getMonth() + '//'
                                        form_data.append('fileDir', fileDir)
                                        var timestamp = Date.parse(new Date());//时间戳
                                        form_data.append('timestamp', timestamp)
                                        var fileAdress=fileDir+timestamp+file_info.name;
                                        alert(fileAdress);
                                        if(file_info==undefined){
                                            alert('你没有选择任何文件');
                                        }else{
                                            $.ajax({
                                                url:"uploadFile",
                                                type:"POST",
                                                data:form_data,
                                                async:false,
                                                processData: false,  // tell jquery not to process the data
                                                contentType: false, // tell jquery not to set contentType,
                                                success:function(data){
                                                    alert(data);
                                                    //window.location.href='login.html';
                                                    //刷新页面
                                                    //location.reload(true);
                                                }
                                            });
                                        }

                                    }

                                </script>



                                <!--结束写入正文-->
                                <!--测试-->

                                <!--测试结束-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--footer,显示版权信息-->
    <script>
        copyRightAceFyb('长安大学汽车学院物流工程系', 'https://qiche.chd.edu.cn/2020/1208/c8529a173474/page.htm/', '2021');
    </script>

</div>

</body>
</html>